package com.google.code.p.restrpc.http;

import java.net.URI;
import java.util.HashMap;
import java.util.Map;

import org.apache.http.HttpEntity;

/**
 * @author dz
 */
public class DefaultHttpClientRequest implements HttpClientRequest {
    
    private URI url;
    
    private HttpEntity body;
    
    private HttpHeaders httpHeaders = new HttpHeaders();
    
    private Map<String, String> headers = new HashMap<String, String>();
    
    public DefaultHttpClientRequest(URI url) {
        this.url = url;
    }
    
    public URI getURI() {
        return url;
    }
    
    public HttpEntity getBody() {
        return body;
    }
    
    public void setBody(HttpEntity body) {
        this.body = body;
    }
    
    public HttpHeaders getHeaders() {
        return httpHeaders;
    }
    
    public void addHeader(String key, String value) {
        this.headers.put(key, value);
    }
    
    public String removeHeader(String key) {
        return this.headers.get(key);
    }
    
    public boolean containsHeader(String key) {
        return this.headers.containsKey(key);
    }
    
}
